﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetMessage
{
    /// <summary>
    /// 网络消息
    /// </summary>
    public class Message
    {
        /// <summary>
        /// 默认构造函数
        /// </summary>
        public Message()
        {
            Params = new List<Paramter>();
        }

        /// <summary>
        /// 消息的名字
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 消息的说明
        /// </summary>
        public string Info { get; set; }

        /// <summary>
        /// 消息的参数
        /// </summary>
        public List<Paramter> Params { get; set; }

        /// <summary>
        /// 网络消息分组
        /// </summary>
        public string Gruop { get; set; }

        /// <summary>
        /// 消息的调用方向
        /// </summary>
        public MessageDirection Direction { get; set; }

        /// <summary>
        /// 返回值
        /// </summary>
        public Paramter ReturnParam { get; set; }

        /// <summary>
        /// 通常在List输出名字时使用
        /// </summary>M
        /// <returns></returns>
        public override string ToString()
        {
            return Name;
        }
    }

    /// <summary>
    /// 消息包的方向
    /// </summary>
    public enum MessageDirection
    {
        Client2GameServer,

        Client2Login,

        Login2Client,

        Login2GameServer,

        GameServer2Client,

        GameServer2Login,
    }
}
